package io.jt808.multiService;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;

import java.net.UnknownHostException;

@Configuration
public class PackageConfig {
    @Bean
    @ConditionalOnMissingBean
    public PackageItemTemplate packageItemTemplate(
            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
        PackageItemTemplate template = new PackageItemTemplate();
        template.setConnectionFactory(redisConnectionFactory);
        return template;
    }
}
